{% with messages = get_flashed_messages(with_categories=true) %}
  {% if messages %}
    <div class="row-fluid">
      <div class="span12">
        {% for category, message in messages %}
          <div class="alert alert-{{ category }}">
            <button type="button" class="close" data-dismiss="alert">×</button>
            {{ message }}
          </div>
        {% endfor %}
      </div>
    </div>
  {% endif %}
{% endwith %}